package DEEPERsource.DEEPERsource.source.machinelearning.kernel;

public class PolynomialKernel implements Kernel<double[]> {

	//by default - linear kernel
	public double gamma = 1;
	public int degree = 1;
	public double coef = 0;

	public double compute(double[] v1, double[] v2) {
		double dot = 0;
		for(int i = 0; i < v1.length; i++)
			dot +=v1[i]*v2[i];
		return Math.pow(gamma*dot+coef, degree);
	}

}
